import {url,axios} from '.';
export const usernameExist = async (username:string) => {
    let res = await axios({
        method:"post",
        url:url + "/users/usernameExist",
        data:{
            username
        }
    });
    return res.data;
}
export const reg = async (data:any) => {
    let res = await axios({
        method:"post",
        url:url + "/users/reg",
        data
    });
    return res.data;
}
export const login = async (data:any) => {
    let res = await axios({
        method:"post",
        url:url + "/users/login",
        data
    });
    return res.data;
}

export const getToken = async () => {
    let res = await axios({
        method:"get",
        url:url + "/getToken"
    });
    return res.data;
}